carga resources ex: nome calendario
begin
  // Initialize the date
  //GotoDatePicker.Date := Date;
  GotoDatePicker.Date := EncodeDate(2002, 1, 1);

  // Initialize the granularity
  TimeIncCombo.ItemIndex := 1; // 30 mins

  // Initialize the mode
  ModeCombo.ItemIndex := 0; // Single mode
  DaysCombo.ItemIndex := 6; // One day

  // Populate the resource related controls
  With SchedulesQuery do
    try
      Open;
      First;
      While not EOF do
        Begin
          ResName := SchedulesQuery.FieldByName('SchedName').AsString;
          ResourceCombo.Items.Add(ResName);
          VisibleResources.ResourcesCheckList.Items.Add(ResName);
          Share.ResourcesCheckList.Items.Add(ResName);
          Next;
        End;
      Close;
    except
      on E:EDBEngineError do
      begin
        ShowMessageFmt('%s:'#13#10'Try moving the database to a shorter path.',[E.Message]);
        Application.Terminate;
        Exit;
      end;
    end;

  // Initialize the resource related controls
  ResourceCombo.ItemIndex := 0;
  VisibleResources.ResourcesCheckList.Checked[0] := True;

  // Initialize the comparative template
  JvTFDays1.Template.CompNames.Add(VisibleResources.ResourcesCheckList.Items[0]);

  // Now run the events to synchronize JvTFDays, etc.
  ResourceComboChange(nil);
  DaysComboChange(nil);
  ModeComboChange(nil);
  GotoDatePicker.Date := EncodeDate(2002, 1, 1);
  GotoDatePickerChange(nil);
  TimeIncComboChange(nil);
end;





comandos criar appt (quando não assigned)
Begin
      // Assume we are adding a new appt
      // Request an appt from the server
      Appt := PhotoOpMain.JvTFDays1.ScheduleManager.dbNewAppt('');
      // Right now this appt object is in a state of flux.  It is not
      // assigned to any schedules and shouldn't be because we're unsure
      // of its data.  The caching system is programmed to automatically
      // destroy any appt objects that are not assigned to any schedules.
      // In this particular situation, this is bad.
      // So...
      // Make the Appt object persistent so the cache does not attempt to
      // flush it while this window is open.
      Appt.Persistent := True;

      // Now populate the appt object with some default data which is
      // retrieved from the JvTFDays grid.
      With Appt do
        Begin
          If DaysGrid.ValidSelection Then
            Begin
              // Set the start/end dates according to the selection
              ApptStartDate := DaysGrid.Cols[DaysGrid.SelStart.X].SchedDate;
              ApptEndDate := DaysGrid.Cols[DaysGrid.SelEnd.X].SchedDate;
              // Set the start/end times according to the selection
              ApptStartTime := DaysGrid.RowToTime(DaysGrid.SelStart.Y);
              ApptEndTime := DaysGrid.RowEndTime(DaysGrid.SelEnd.Y);
            End
          Else
            Begin
              // Set the start/end dates to today
              ApptStartDate := Date;
              ApptEndDate := Date;
              // Set the start/end times to now and now + granularity
              ApptStartTime := Time;
                // Subtract one min from granularity, then add the minute back in.
                //  (Avoids minute overflow when granularity is 60)
              ApptEndTime := ApptStartTime +
                             EncodeTime(0, DaysGrid.Granularity - 1, 0, 0) +
                             EncodeTime(0, 1, 0, 0);
            End;

          Appt.BeginUpdate;
          // Call BeginUpdate so that the appt will NOT be posted when we
          // set the following properties.  Don't worry about calling
          // EndUpdate here.  It will be called if the user chooses 'OK' to
          // save the new appt.  See FormClose below.

          SetStartEnd(ApptStartDate, ApptStartTime, ApptEndDate, ApptEndTime);
          AlarmEnabled := True;
          AlarmAdvance := 15;
        End;
end;
		
		
		
para postar appt
If (ModalResult = mrOK) and Assigned(Appt) Then
    With Appt do
      Begin
        Appt.BeginUpdate;
        // Call BeginUpdate so that the appt is not posted while we are
        // setting its properties.

        Try
          // Copy the data from the window fields to the appt object
          SetStartEnd(StartDatePicker.Date, StartTimePicker.Time,
                      EndDatePicker.Date, EndTimePicker.Time);
          AlarmEnabled := AlarmEnabledCheck.Checked;
          AlarmAdvance := StrToInt(AlarmAdvanceEdit.Text);
          Description := Edit1.Text;

          If AddingAppt Then
            Begin
              // Just a shortcut to save some typing :-)
              DaysGrid := PhotoOpMain.JvTFDays1;

              // Add the appt to selected schedule(s)
              For I := 0 to DaysGrid.Cols.Count - 1 do
                Appt.AddSchedule(DaysGrid.Cols[I].SchedName);

              // Now that we're done working with the appointment and it is
              // actually assigned to a schedule, we should set the Persistent
              // property to false.  This will ensure the the caching system
              // will properly dispose of the appointment object when it is
              // no longer needed.
              Appt.Persistent := False;
            End;
        Finally
          Appt.EndUpdate;  // this causes the appt to be posted
        End;
      End
  Else If AddingAppt Then
    // The user canceled the window, but we have already created the appt
    // object.  We need to clean up the appt object we requested from the
    // server.  This can be done either by manually destroying the appt
    // object (Appt.Free), or by setting Appt.Persistent to false.
    Appt.Free;

  // Set Appt to nil to prepare window for next opening
  Appt := nil;